import java.io.File;
import java.io.IOException;

import lexer.Lexer;
import lexer.TokenTable;

public class Main {
	public static void main(String args[]) {
		for (int i = 0; i < 6; i++) {
			TokenTable tokenTable = new TokenTable();
			File srcFile = new File(System.getProperty("user.dir") + "/examples/0" + i + "_var_defn.sy");
			File exmFile = new File(System.getProperty("user.dir") + "/examples/0" + i + "_var_defn.txt");
			File outFile = new File(System.getProperty("user.dir") + "/out/0" + i + "_var_defn.lexed");
			Lexer lexer = new Lexer(srcFile, tokenTable);
			lexer.work();
			System.out.println(outFile);
			try {
				outFile.createNewFile();
			} catch (IOException e) {
				e.printStackTrace();
			}
			tokenTable.printToken2File(outFile);
			FileCompare fileCompare = new FileCompare();
			fileCompare.compareFile(exmFile, outFile);
		}
	}
}
